package com.nian.common.lock.zookeeper;

import com.nian.common.lock.redis.IRedisLock;
import com.nian.common.model.ServerResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

/**
 * 用途：
 * 开发：zhangmj
 * 日期：2020/4/13 0013 20:34
 */
@Slf4j
@RestController
@RequestMapping("testZookeeperLock")
public class TestZookeeperLock {

    @Autowired
    IZookeeperLock iZookeeperLock;

    @PostMapping("lock")
    public ServerResponse tryLock(){
        return iZookeeperLock.lock(new SimpleZookeepWorker());
    }
}
